﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RRs1301haigla4Response", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RRs1301haigla4Response))]
    public class RRs1301haigla4ResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRRs1301haigla4Response clazz;
        
        public RRs1301haigla4ResponseSerializer(IRRs1301haigla4Response clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            if (clazz.TtSonum2!=null) {
                Writer.WriteStartElement("ttSonum2");
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RRs1301haigla4Response>ttSonum2>ttSonum2", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.TtSonum2.Count);
                for (int x = 0; ((clazz.TtSonum2 != null) 
                            && (x < clazz.TtSonum2.Count)); x = (x + 1)) {
                    if (clazz.TtSonum2[x]!=null) {
                        Writer.WriteStartElement("ttSonum2");
                        global::Xtee.Core.SerializationMetadata metaTtSonum2 = this.GetMetaData(clazz.TtSonum2[x]);
                        Writer.WriteTypeAttribute(metaTtSonum2.TypeQualifiedName.Namespace, metaTtSonum2.TypeQualifiedName.Name);
                        metaTtSonum2.NewSerializer(clazz.TtSonum2[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
                Writer.WriteEndElement();
            }
            if (clazz.TtSonum2A!=null) {
                Writer.WriteStartElement("ttSonum2_a");
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.TtSonum2A.Count);
                for (int x = 0; ((clazz.TtSonum2A != null) 
                            && (x < clazz.TtSonum2A.Count)); x = (x + 1)) {
                    if (clazz.TtSonum2A[x]!=null) {
                        Writer.WriteStartElement("ttSonum2_a");
                        global::Xtee.Core.SerializationMetadata metaTtSonum2A = this.GetMetaData(clazz.TtSonum2A[x]);
                        Writer.WriteTypeAttribute(metaTtSonum2A.TypeQualifiedName.Namespace, metaTtSonum2A.TypeQualifiedName.Name);
                        metaTtSonum2A.NewSerializer(clazz.TtSonum2A[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
                Writer.WriteEndElement();
            }
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="ttSonum2") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RRs1301haigla4Response>ttSonum2");
                }
                clazz.TtSonum2 = new System.Collections.Generic.List<RRs1301haigla4Response.ITtSonum2Type>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ttSonum2");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ttSonum2")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RRs1301haigla4Response>ttSonum2>ttSonum2");
                        }
                        global::Xtee.Core.SerializationMetadata metaTtSonum2 = this.GetMetaData<RRs1301haigla4Response.ITtSonum2Type>(Reader, ">>>RRs1301haigla4Response>ttSonum2>ttSonum2", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RRs1301haigla4Response.ITtSonum2Type item = metaTtSonum2.NewEntity<RRs1301haigla4Response.ITtSonum2Type>();
                        clazz.TtSonum2.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ttSonum2");
                            metaTtSonum2.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            if (Reader.LocalName=="ttSonum2_a") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RRs1301haigla4Response>ttSonum2_a");
                }
                clazz.TtSonum2A = new System.Collections.Generic.List<RRs1301haigla4Response.ITtSonum2AType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ttSonum2_a");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ttSonum2_a")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a");
                        }
                        global::Xtee.Core.SerializationMetadata metaTtSonum2A = this.GetMetaData<RRs1301haigla4Response.ITtSonum2AType>(Reader, ">>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RRs1301haigla4Response.ITtSonum2AType item = metaTtSonum2A.NewEntity<RRs1301haigla4Response.ITtSonum2AType>();
                        clazz.TtSonum2A.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ttSonum2_a");
                            metaTtSonum2A.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RRs1301haigla4Response>ttSonum2>ttSonum2", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RRs1301haigla4Response.TtSonum2Type))]
        public class TtSonum2TypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RRs1301haigla4Response.ITtSonum2Type clazz;
            
            public TtSonum2TypeSerializer(RRs1301haigla4Response.ITtSonum2Type clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.TtSonum2dtellimusnr!=null) {
                    Writer.WriteStartElement("ttSonum2.dtellimusnr");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2dtellimusnr))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2dlapsKood!=null) {
                    Writer.WriteStartElement("ttSonum2.dlaps_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2dlapsKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2demaIkood!=null) {
                    Writer.WriteStartElement("ttSonum2.dema_ikood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2demaIkood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2cemaPere!=null) {
                    Writer.WriteStartElement("ttSonum2.cema_pere");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2cemaPere))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2cemaEes!=null) {
                    Writer.WriteStartElement("ttSonum2.cema_ees");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2cemaEes))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2iriik!=null) {
                    Writer.WriteStartElement("ttSonum2.iriik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2iriik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2imaak!=null) {
                    Writer.WriteStartElement("ttSonum2.imaak");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2imaak))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2ivald!=null) {
                    Writer.WriteStartElement("ttSonum2.ivald");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2ivald))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2iasula!=null) {
                    Writer.WriteStartElement("ttSonum2.iasula");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2iasula))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2caadress!=null) {
                    Writer.WriteStartElement("ttSonum2.caadress");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2caadress))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2ivigaKood!=null) {
                    Writer.WriteStartElement("ttSonum2.iviga_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2ivigaKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2cvigaTekst!=null) {
                    Writer.WriteStartElement("ttSonum2.cviga_tekst");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2cvigaTekst))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ttSonum2.dtellimusnr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.dtellimusnr");
                    }
                    clazz.TtSonum2dtellimusnr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.dtellimusnr")).Value;
                }
                if (Reader.LocalName=="ttSonum2.dlaps_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.dlaps_kood");
                    }
                    clazz.TtSonum2dlapsKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.dlaps_kood")).Value;
                }
                if (Reader.LocalName=="ttSonum2.dema_ikood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.dema_ikood");
                    }
                    clazz.TtSonum2demaIkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.dema_ikood")).Value;
                }
                if (Reader.LocalName=="ttSonum2.cema_pere") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.cema_pere");
                    }
                    clazz.TtSonum2cemaPere = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.cema_pere")).Value;
                }
                if (Reader.LocalName=="ttSonum2.cema_ees") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.cema_ees");
                    }
                    clazz.TtSonum2cemaEes = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.cema_ees")).Value;
                }
                if (Reader.LocalName=="ttSonum2.iriik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.iriik");
                    }
                    clazz.TtSonum2iriik = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2.iriik")).Value;
                }
                if (Reader.LocalName=="ttSonum2.imaak") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.imaak");
                    }
                    clazz.TtSonum2imaak = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2.imaak")).Value;
                }
                if (Reader.LocalName=="ttSonum2.ivald") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.ivald");
                    }
                    clazz.TtSonum2ivald = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2.ivald")).Value;
                }
                if (Reader.LocalName=="ttSonum2.iasula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.iasula");
                    }
                    clazz.TtSonum2iasula = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2.iasula")).Value;
                }
                if (Reader.LocalName=="ttSonum2.caadress") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.caadress");
                    }
                    clazz.TtSonum2caadress = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.caadress")).Value;
                }
                if (Reader.LocalName=="ttSonum2.iviga_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.iviga_kood");
                    }
                    clazz.TtSonum2ivigaKood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2.iviga_kood")).Value;
                }
                if (Reader.LocalName=="ttSonum2.cviga_tekst") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2>ttSonum2>ttSonum2.cviga_tekst");
                    }
                    clazz.TtSonum2cvigaTekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2.cviga_tekst")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RRs1301haigla4Response.TtSonum2AType))]
        public class TtSonum2ATypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RRs1301haigla4Response.ITtSonum2AType clazz;
            
            public TtSonum2ATypeSerializer(RRs1301haigla4Response.ITtSonum2AType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.TtSonum2Adtellimusnr!=null) {
                    Writer.WriteStartElement("ttSonum2_a.dtellimusnr");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2Adtellimusnr))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AdlapsKood!=null) {
                    Writer.WriteStartElement("ttSonum2_a.dlaps_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AdlapsKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AdemaIkood!=null) {
                    Writer.WriteStartElement("ttSonum2_a.dema_ikood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AdemaIkood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AcemaPere!=null) {
                    Writer.WriteStartElement("ttSonum2_a.cema_pere");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AcemaPere))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AcemaEes!=null) {
                    Writer.WriteStartElement("ttSonum2_a.cema_ees");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AcemaEes))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2Airiik!=null) {
                    Writer.WriteStartElement("ttSonum2_a.iriik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2Airiik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2Aimaak!=null) {
                    Writer.WriteStartElement("ttSonum2_a.imaak");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2Aimaak))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2Aivald!=null) {
                    Writer.WriteStartElement("ttSonum2_a.ivald");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2Aivald))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2Aiasula!=null) {
                    Writer.WriteStartElement("ttSonum2_a.iasula");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2Aiasula))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2Acaadress!=null) {
                    Writer.WriteStartElement("ttSonum2_a.caadress");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2Acaadress))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AcVkpv!=null) {
                    Writer.WriteStartElement("ttSonum2_a.cVkpv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AcVkpv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AivigaKood!=null) {
                    Writer.WriteStartElement("ttSonum2_a.iviga_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TtSonum2AivigaKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TtSonum2AcvigaTekst!=null) {
                    Writer.WriteStartElement("ttSonum2_a.cviga_tekst");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TtSonum2AcvigaTekst))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ttSonum2_a.dtellimusnr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.dtellimusnr");
                    }
                    clazz.TtSonum2Adtellimusnr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.dtellimusnr")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.dlaps_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.dlaps_kood");
                    }
                    clazz.TtSonum2AdlapsKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.dlaps_kood")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.dema_ikood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.dema_ikood");
                    }
                    clazz.TtSonum2AdemaIkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.dema_ikood")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.cema_pere") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.cema_pere");
                    }
                    clazz.TtSonum2AcemaPere = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.cema_pere")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.cema_ees") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.cema_ees");
                    }
                    clazz.TtSonum2AcemaEes = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.cema_ees")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.iriik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.iriik");
                    }
                    clazz.TtSonum2Airiik = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2_a.iriik")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.imaak") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.imaak");
                    }
                    clazz.TtSonum2Aimaak = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2_a.imaak")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.ivald") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.ivald");
                    }
                    clazz.TtSonum2Aivald = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2_a.ivald")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.iasula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.iasula");
                    }
                    clazz.TtSonum2Aiasula = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2_a.iasula")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.caadress") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.caadress");
                    }
                    clazz.TtSonum2Acaadress = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.caadress")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.cVkpv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.cVkpv");
                    }
                    clazz.TtSonum2AcVkpv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.cVkpv")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.iviga_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.iviga_kood");
                    }
                    clazz.TtSonum2AivigaKood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ttSonum2_a.iviga_kood")).Value;
                }
                if (Reader.LocalName=="ttSonum2_a.cviga_tekst") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RRs1301haigla4Response>ttSonum2_a>ttSonum2_a>ttSonum2_a.cviga_tekst");
                    }
                    clazz.TtSonum2AcvigaTekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ttSonum2_a.cviga_tekst")).Value;
                }
            }
        }
    }
}
